package com.xl.basic.controller;

import com.xl.basic.annotation.LogIgnored;
import com.xl.basic.annotation.RoleValidated;
import com.xl.basic.entity.Result;
import com.xl.basic.entity.SPage;
import com.xl.basic.entity.param.QueryVisitLogParam;
import com.xl.basic.service.VisitLogService;
import com.xl.dao.domain.XlVisitLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 钟勇
 * Create in 2023/8/24 9:57
 */
@Tag(name = "访问日志")
@RestController
@RequestMapping("/api/VisitLog")
@RequiredArgsConstructor
@LogIgnored
@RoleValidated
public class VisitLogController {
    private final VisitLogService visitLogService;

    @Operation(summary = "查询访问日志分页")
    @PostMapping(value = "/queryVisitLogPage")
    Result<List<XlVisitLog>> queryVisitLogPage(@Validated QueryVisitLogParam param, SPage sPage) {
        return visitLogService.queryVisitLogPage(param, sPage);
    }
}
